package org.railage.server.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.NamedNativeQuery;

/**
 * Station entity
 * 
 * @author Cyril Fertikov
 * 
 */
@NamedNativeQuery(
		name = "getOrderedStationsOfTrip", 
		query = "call proc_get_ordered_stations_of_trip(:id_trip)", 
		resultClass = Station.class
)
@Entity
@Table(name = "station")
public class Station implements Serializable {
	private static final long serialVersionUID = 754525897698710665L;

	@Id
	@GeneratedValue
	@Column(name = "id")
	private int id;

	@Column(name = "name")
	private String name;

	public Station() {

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Station [id=" + id + ", name=" + name + "]";
	}

}
